// 快照沙箱
class SnapshotSandBox{
  windowSnapshot = {};
  modifyPropsMap = {};
  active(){
      for(const prop in window){ // 存储父应用快照
          this.windowSnapshot[prop] = window[prop];
      }
      Object.keys(this.modifyPropsMap).forEach(prop=>{ // 上次存储的子应用快照和父window结合
          window[prop] = this.modifyPropsMap[prop];
      });
  }
  inactive(){
      for(const prop in window){
          if(window[prop] !== this.windowSnapshot[prop]){
              this.modifyPropsMap[prop] = window[prop];
              window[prop] = this.windowSnapshot[prop];
          }
      }
  }
}
